public class Date {
    public int year;
    public int month;
    public int day;
    public Date(){
        this.year=1;
        this.month=1;
        this.day=1;
        System.out.println("执行了不带参数的构造方法");
    }
    public Date(int year,int month,int day){
        this.year=year;
        this.month=month;
        this.day=day;
        System.out.println("执行了带三个参数的构造方法");
    }
    public Date(int year,int month){
        this.year=year;
        this.month=month;
        System.out.println("执行了带两个参数的构造方法");
    }
//鼠标右键Generate后选择Constructor选择对应的参数，编译器会自动给你生成构造方法
//按住ctr可多选

    public Date(int month) {
        this.month = month;
    }

    public void setDay(int year, int month, int day) {
        this.year=year;
        this.month=month;
        this.day=day;
    }
    public void printDay() {
        System.out.println(year+"年"+month+"月"+day+"日");
    }
}


